#ifndef     __ERROR_H
#define     __ERROR_H

#include <stdexcept>
#include <QString>

class BaseException : public std::exception {

public:
    BaseException(const QString &msg);

    const QString &msg() { return m_msg; }

protected:
    const char* what() const override;

private:
    const QString m_msg;
};


class FFmpegException : public BaseException {

public:
    FFmpegException(const char *info, int ec = 0);

};

class SDLException : public BaseException {

public:
    SDLException(const char *info);
};

void debug(const QString &msg);


#endif
